package app.vendorportal.api.data;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

import java.sql.Time;
import java.util.Date;

/**
 * @author Bribin
 */
@XmlRootElement(name = "delivery-info")
@XmlAccessorType(XmlAccessType.FIELD)
@Deprecated
public class DeliveryInfo {

    @XmlElement(name = "warehouse-info")
    private WarehouseInfo warehouseInfo;

    @XmlElement(name = "shipping-method-info")
    private ShippingMethodInfo shippingMethodInfo;

    // the smaller one between (shipper's pickup time) and (warehouse's close time - fulfillment time)
    @XmlTransient
    private Time cutoff;

    @XmlElement(name = "cutoff-time")
    private String cutoffTime;

    // translate cutoff time to the timezone of queried zip code
    @XmlTransient
    private Time localCutoff;

    @XmlElement(name = "local-cutoff-time")
    private String localCutOffTime;

    @XmlElement(name = "ship-date-before-cutoff")
    private Date shipDateBeforeCutoff;

    @XmlElement(name = "delivery-date-before-cutoff")
    private Date deliveryDateBeforeCutoff;

    @XmlElement(name = "ship-date-after-cutoff")
    private Date shipDateAfterCutoff;

    @XmlElement(name = "delivery-date-after-cutoff")
    private Date deliveryDateAfterCutoff;

    @XmlElement(name = "tnt")
    private int tnt;

    public String getCutoffTime() {
        return cutoffTime;
    }

    public void setCutoffTime(String cutoffTime) {
        this.cutoffTime = cutoffTime;
        this.cutoff = Time.valueOf(cutoffTime);
    }

    public Date getShipDateBeforeCutoff() {
        return shipDateBeforeCutoff;
    }

    public void setShipDateBeforeCutoff(Date shipDateBeforeCutoff) {
        this.shipDateBeforeCutoff = shipDateBeforeCutoff;
    }

    public Date getDeliveryDateBeforeCutoff() {
        return deliveryDateBeforeCutoff;
    }

    public void setDeliveryDateBeforeCutoff(Date deliveryDateBeforeCutoff) {
        this.deliveryDateBeforeCutoff = deliveryDateBeforeCutoff;
    }

    public Date getShipDateAfterCutoff() {
        return shipDateAfterCutoff;
    }

    public void setShipDateAfterCutoff(Date shipDateAfterCutoff) {
        this.shipDateAfterCutoff = shipDateAfterCutoff;
    }

    public Date getDeliveryDateAfterCutoff() {
        return deliveryDateAfterCutoff;
    }

    public void setDeliveryDateAfterCutoff(Date deliveryDateAfterCutoff) {
        this.deliveryDateAfterCutoff = deliveryDateAfterCutoff;
    }

    public int getTnt() {
        return tnt;
    }

    public void setTnt(int tnt) {
        this.tnt = tnt;
    }

    public String getLocalCutOffTime() {
        return localCutOffTime;
    }

    public void setLocalCutOffTime(String localCutOffTime) {
        this.localCutOffTime = localCutOffTime;
        this.localCutoff = Time.valueOf(localCutOffTime);
    }

    public Time getCutoff() {
        return cutoff;
    }

    public void setCutoff(Time cutoff) {
        this.cutoff = cutoff;
        this.cutoffTime = cutoff.toString();
    }

    public WarehouseInfo getWarehouseInfo() {
        return warehouseInfo;
    }

    public void setWarehouseInfo(WarehouseInfo warehouseInfo) {
        this.warehouseInfo = warehouseInfo;
    }

    public ShippingMethodInfo getShippingMethodInfo() {
        return shippingMethodInfo;
    }

    public void setShippingMethodInfo(ShippingMethodInfo shippingMethodInfo) {
        this.shippingMethodInfo = shippingMethodInfo;
    }

    public Time getLocalCutoff() {
        return localCutoff;
    }

    public void setLocalCutoff(Time localCutoff) {
        this.localCutoff = localCutoff;
        this.localCutOffTime = localCutoff.toString();
    }

}
